<nav class="navbar navbar-default" role="navigation">
    <!-- Brand and toggle get grouped for better mobile display -->
    <div class="navbar-header">
        <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
        </button>
        <a class="navbar-brand" href="#">Title</a>
    </div>

    <!-- Collect the nav links, forms, and other content for toggling -->
    <div class="collapse navbar-collapse navbar-ex1-collapse">
        
        <ul class="nav navbar-nav navbar-right">
            <% if(!uid){ %>
            <li><a href="/login">登录</a></li>
            <li><a href="/register">注册</a></li>
            <%}else{%>
                <li><a href=""><%= username%></a></li>
                <li><a href="/logout">退出</a></li>
            <%}%>
        </ul>
    </div><!-- /.navbar-collapse -->
</nav>